# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-requirements-parser
_pkgname=requirements_parser
pkgver=0.13.0
_pyver=3.13
pkgrel=1
pkgdesc='A Pip requirements file parser.'
arch=('any')
url='https://pypi.org/project/requirements-parser'
license=('BSD')
depends=('python')
makedepends=('python-pip' 'python-build' 'python-wheel')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('7be84cc2a10f7ef2e64891534b259b0e3d47c392933f9f4832172fe00399ad4c7f913983d170fb36b417ddd2802765cb196397e444e6895c965b8e2737a4f584')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname

  rm -rf "$pkgdir/usr/lib/python$_pyver/site-packages/"{README.md,CHANGELOG.txt,LICENSE,AUTHORS.rst}
}

